ci: Generate the report for the release builds
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 29 Jan 2020 13:36:23 +0000 (14:36 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 11 Feb 2020 14:47:22 +0000 (14:47 +0000)
We are going to need to hide the report generation into the test runner
script, as we want the job to produce the reports even in case of
failure, instead of bailing out immediately.

.gitlab-ci.yml
.gitlab-ci/run-tests.sh

index 276b3e903d0f827c592d918b6c38e9ccd359360a..26e4c0ea10660d627a1518a5b70b7f581177d4fe 100644 (file)
@@ -34,17 +34,6 @@ fedora-x86_64:
             _build
     - ninja -C _build
     - .gitlab-ci/run-tests.sh _build
-    - .gitlab-ci/meson-junit-report.py
-            --project-name=gtk
-            --job-id="${CI_JOB_NAME}"
-            --output=_build/report.xml
-            _build/meson-logs/testlog.json
-    - .gitlab-ci/meson-html-report.py
-            --project-name=gtk
-            --job-id="${CI_JOB_NAME}"
-            --reftest-output-dir="_build/testsuite/reftests/output"
-            --output=_build/report.html
-            _build/meson-logs/testlog.json
   artifacts:
     when: always
     reports:
@@ -76,11 +65,6 @@ release-build:
             _build
     - ninja -C _build
     - .gitlab-ci/run-tests.sh _build
-    - .gitlab-ci/meson-junit-report.py
-            --project-name=gtk
-            --job-id="${CI_JOB_NAME}"
-            --output=_build/report.xml
-            _build/meson-logs/testlog.json
   artifacts:
     when: always
     reports:
@@ -90,6 +74,10 @@ release-build:
     paths:
       - "${CI_PROJECT_DIR}/_build/meson-logs"
       - "${CI_PROJECT_DIR}/_build/report.xml"
+      - "${CI_PROJECT_DIR}/_build/report.html"
+      - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
+      - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
+      - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap"
   cache:
     key: "$CI_JOB_NAME"
     <<: *cache-paths
index 136988e11ea280a0c63c75348ab7047640b26155..9bac5b93c81e7dde0b2c3fd7c71a2f76b3219123 100755 (executable)
@@ -1,11 +1,32 @@
 #!/bin/bash
 
-set -e
+set +x
+set +e
 
+srcdir=$( pwd )
 builddir=$1
 
-cd ${builddir}
+export GDK_BACKEND=x11
 xvfb-run -a -s "-screen 0 1024x768x24" \
-        meson test --print-errorlogs \
+        meson test -C ${builddir} \
+                --print-errorlogs \
                 --suite=gtk \
                 --no-suite=gtk:a11y
+
+# Store the exit code for the CI run, but always
+# generate the reports
+exit_code=$?
+
+$srcdir/.gitlab-ci/meson-junit-report.py \
+        --project-name=gtk \
+        --job-id="${CI_JOB_NAME}" \
+        --output=${builddir}/report.xml \
+        ${builddir}/meson-logs/testlog.json
+$srcdir/.gitlab-ci/meson-html-report.py \
+        --project-name=gtk \
+        --job-id="${CI_JOB_NAME}" \
+        --reftest-output-dir="${builddir}/testsuite/reftests/output" \
+        --output=${builddir}/report.html \
+        ${builddir}/meson-logs/testlog.json
+
+exit $exit_code